<?php
if(!isset($_SESSION)) 
	{ 
		session_start(); 
	}
header('Content-Type: text/xml');
 $database = $_REQUEST['db'];
$id_employee = $_REQUEST['employeeID'];
$mysqli = new mysqli("1.234.53.52", "cam", "5678","$database");
//$mysqli = new mysqli("localhost", "root", "root","$database");
	$query = mysqli_query($mysqli,"call getTotalDocument($id_employee)");	
	echo '<?xml version="1.0" encoding="UTF-8"?> ';
	echo '<data>';
	while($row = mysqli_fetch_array($query)){
		
		echo '<my_received>';
			echo '<num_re_pending>'.$row[RePendingDoc].'</num_re_pending>';
			echo '<num_re_not_approve>'.$row[ReNotApprovedDoc].'</num_re_not_approve>';
			echo '<num_re_approved>'.$row[ReApprovedDoc].'</num_re_approved>';
			echo '<num_re_declined>'.$row[ReDeclinedDoc].'</num_re_declined>';
			echo '<num_re_reference_approved>'.$row[ReRefApprovedDoc].'</num_re_reference_approved>';
			echo '<num_re_reference_waiting>'.$row[ReRefWaitingDoc].'</num_re_reference_waiting>';
			echo '<num_re_received_metting>'.$row[ReMeetingDoc].'</num_re_received_metting>';
		echo '</my_received>';
		
		echo '<my_document>';
			echo '<num_my_sendingDoc>'.$row[MySendingDoc].'</num_my_sendingDoc>';
			echo '<num_my_savedDoc>'.$row[MySavedDoc].'</num_my_savedDoc>';
			echo '<num_my_approveDoc>'.$row[MyApproveDoc].'</num_my_approveDoc>';
			echo '<num_my_declinedDoc>'.$row[MyDeclinedDoc].'</num_my_declinedDoc>';
			echo '<num_my_meetingDoc>'.$row[MyMeetingDoc].'</num_my_meetingDoc>';
		echo '</my_document>';
		
		echo '<my_re_bin>';
			echo '<num_bin_re_doc>'.$row[BinReceiverDoc].'</num_bin_re_doc>';
			echo '<num_bin_send_doc>'.$row[BinSendingDoc].'</num_bin_send_doc>';
		echo '</my_re_bin>';
	}
	
	mysqli_close($mysqli);
	echo '</data>';
	
?>